package com.yzx.controller.system;

import com.yzx.service.SysOperLogService;
import com.yzx.vo.AjaxResult;
import com.yzx.vo.DataGridView;
import dto.SysOperLogDto;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Log4j2
@RestController
@RequestMapping("system/operLog")
public class OperLogController {
    @Autowired
    private SysOperLogService operLogService;

    /**
     * 分页查询
     */
    @GetMapping("listForPage")
    public AjaxResult listForPage(SysOperLogDto operLogDto){
        DataGridView gridView = operLogService.listForPage(operLogDto);
        return AjaxResult.success("查询成功",gridView.getData(),gridView.getTotal());
    }

//    /**
//     * 删除
//     */
//    @DeleteMapping("deleteOperLogByIds/{infoIds}")
//    public AjaxResult deleteOperLogByIds(@PathVariable Long[] infoIds){
//
//        return AjaxResult.toAjax(this.operLogService.deleteOperLogByIds(infoIds));
//    }
    /**
     * 清空删除
     */
    @DeleteMapping("clearAllOperLog")
    public AjaxResult clearAllOperLog(){
        return AjaxResult.toAjax(this.operLogService.clearAllOperLog());
    }

}
